define(['jquery', 'bootstrap', 'frontend', 'template', 'form'], function ($, undefined, Frontend, Template, Form) {
    var Controller = {
        index: function () {
            $(document.body).on("click", "#reading", function () {
                Fast.api.ajax({
                    url: "message/reading",
                    data: {},
                }, function (data, ret) {
                    setTimeout(
                        "location.reload()",2000
                    );
                });
            });
            return false;
        },
        details: function () {
            $(document.body).on("click", "#del_message", function () {
                var rec_id = $(this).data('rec_id');
                Fast.api.ajax({
                    url: "message/del",
                    data: {rec_id: rec_id},
                }, function (data, ret) {
                    setTimeout(
                        "window.location.href = document.referrer", 2000
                    );
                });
            });
            return false;
        }
    };
    return Controller;
});